import request from '@/utils/request'

// 查询歌曲列表
export function listTracks(query) {
  return request({
    url: '/tracks/tracks/list',
    method: 'get',
    params: query
  })
}

// 查询歌曲详细
export function getTracks(id) {
  return request({
    url: '/tracks/tracks/' + id,
    method: 'get'
  })
}

// 新增歌曲
export function addTracks(data) {
  return request({
    url: '/tracks/tracks',
    method: 'post',
    data: data
  })
}

// 修改歌曲
export function updateTracks(data) {
  return request({
    url: '/tracks/tracks',
    method: 'put',
    data: data
  })
}

// 删除歌曲
export function delTracks(id) {
  return request({
    url: '/tracks/tracks/' + id,
    method: 'delete'
  })
}

export function getTrackTitles(personId) {
  return request({
    url: `/tracks/tracks/trackDetails/${personId}`,
    method: 'get'
  })
}

export function getLoveTitles(currentUserId) {
  return request({
    url: `/tracks/tracks/loveDetails/${currentUserId}`,
    method: 'get'
  })
}

export function getRecommendTitles(currentUserId) {
  return request({
    url: `/tracks/tracks/recommend/${currentUserId}`,
    method: 'get'
  })
}
